<h1>用户注册</h1>

<div class="row">
  <div class="col-sm-5">
    <%= form_for @user, url: users_path, method: :post do |f| %>
      <div class="form-group">
        <ul class="list-unstyled">
          <% @user.errors.messages.values.flatten.each do |error| %>
          <li><i class="fa"><% error %></i></li>
          <% end %>
        </ul>
      </div>

      <div class="form-group"><%= f.text_field :username, class: 'form-control', placeholder: '用户名' %></div>
      <div class="form-group"><%= f.password_field :password, class: 'form-control', placeholder: '密码' %></div>
      <div class="form-group"><%= f.password_field :password_confirmation, class: 'form-control', placeholder: '密码确认' %></div>
      <%= f.submit "注册", class: 'btn btn-primary' %>
      <%= link_to "登录", new_session_path %>
    <% end %>
  </div>
</div>
